let container = document.querySelector('div.container')
//1.获取当前页面的 浏览器中传递的producid参数

//2.根据productid向后端发起请求,获取数据

//3.获取数据之后渲染

let id = getQueryString('productid');
console.log(id)

fetch('http://chst.vip:1234/api/getmoneyctrlproduct?productid=' + id)
    .then(body => body.json())
    .then(res => {
        console.log(res)
        let r = res.result[0];
        // console.log(r)
        let regExp = /(?<=imgurl=)[^'"]*/;
        let url = r.productImg2.match(regExp);
        // console.log(url)
        let el = `
                    <div class="title">
                        <h4>${r.productName}</h4>
                    </div>
                    <div class="other">
                        <span class="mall fl">${r.productFrom} | ${r.productTime}</span>
                        <i>${r.productTips}</i>
                    </div>
                    <div class="word">
                        <p>
                            <img src=${url[0]}>
                            ${r.productInfo2}
                        </p>
                    </div>
                    <div class="bigimg">
                        <img src=${url[0]}>
                    </div>`

        container.innerHTML = el;
    })
